Download File
GET
/api/v1/users/me/files/:id/downloadReturns a short-lived signed download URL (15-minute TTL) for the attachment. Re-fetch on demand rather than caching the URL.
cv-api-key + Bearer accessToken
Production
https://api.care360-next.carevalidate.com/api/v1/users/me/files/{id}/downloadStaging
https://api-staging.care360-next.carevalidate.com/api/v1/users/me/files/{id}/downloadHeaders
Headers
cv-api-keystringrequiredYour unique API key for authentication.
AuthorizationstringrequiredBearer access token from /verify-otp.
Path Parameters
Path Parameters
idstringrequiredAttachment UUID.
Example:
550e8400-e29b-41d4-a716-446655440000Behavior
The same uniform-404 rules from /metadata apply. A missing bucket-side object (DB row exists, bucket file does not) propagates as a top-level internal error.
Response Shape
| Field | Type | Notes |
|---|---|---|
downloadUrl | string | Short-lived signed URL into the GCS bucket (V4 read action). |
fileName | string | The current file name to use as the download filename. |
expiresIn | number | 900 (seconds). Matches the 15-minute signed-URL TTL. |
Example Request
- cURL
- JavaScript
- Python
curl -X GET '<BASE_URL>/api/v1/users/me/files/<id>/download' \
-H 'cv-api-key: <redacted>' \
-H 'Authorization: Bearer <accessToken>'
const response = await fetch(
'<BASE_URL>/api/v1/users/me/files/<id>/download',
{
method: 'GET',
headers: {
'cv-api-key': '<redacted>',
'Authorization': 'Bearer <accessToken>',
},
}
);
const { data } = await response.json();
window.location.assign(data.downloadUrl);
import requests
response = requests.get(
'<BASE_URL>/api/v1/users/me/files/<id>/download',
headers={
'cv-api-key': '<redacted>',
'Authorization': 'Bearer <accessToken>',
},
)
print(response.json())
Responses
▶200Success
{
"status": 200,
"success": true,
"data": {
"downloadUrl": "https://storage.googleapis.com/...&X-Goog-Expires=900",
"fileName": "lab-result.pdf",
"expiresIn": 900
}
}
▶400Validation error
{
"status": 400,
"success": false,
"error": "Validation failed",
"code": "VALIDATION_ERROR"
}
▶401Authentication failure
{
"status": 401,
"success": false,
"error": "Invalid or expired token",
"code": "VALIDATION_ERROR"
}
▶404File not found
{
"status": 404,
"success": false,
"error": "File not found",
"code": "VALIDATION_ERROR"
}
Try It Out
Try itAPI Playground
▶